import pymysql
class DB:
    def __init__(self):
        self.conn=pymysql.connect(host='localhost',port=3306,user='root',password='123',db='lian',charset='utf8',
        cursorclass=pymysql.cursors.DictCursor)
        self.cousor=self.conn.cursor()


    def insert(self,sql):
        self.cousor.execute(sql)
        self.conn.commit()

    def find(self,sql):
        self.cousor.execute(sql)
        return self.cousor.fetchall()


db1=DB()

